/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Marcio
 */
@Entity
@Table(name = "SGPAIS")
@NamedQueries({
    @NamedQuery(name = "Sgpais.findAll", query = "SELECT s FROM Sgpais s")})
public class Sgpais implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CODPAIS")
    private Short codpais;
    @Basic(optional = false)
    @Column(name = "NOMEPAIS")
    private String nomepais;
    @Basic(optional = false)
    @Column(name = "SIGLA3CPAIS")
    private String sigla3cpais;
    @Column(name = "DDIPAIS")
    private Short ddipais;
    @Basic(optional = false)
    @Column(name = "SIGLA2CPAIS")
    private String sigla2cpais;
    @Column(name = "CODBACENPAIS")
    private Integer codbacenpais;
    @Column(name = "CODEANPAIS")
    private String codeanpais;
    @Basic(optional = false)
    @Column(name = "DTINS")
    @Temporal(TemporalType.DATE)
    private Date dtins;
    @Basic(optional = false)
    @Column(name = "HINS")
    @Temporal(TemporalType.TIME)
    private Date hins;
    @Basic(optional = false)
    @Column(name = "IDUSUINS")
    private String idusuins;
    @Column(name = "DTALT")
    @Temporal(TemporalType.DATE)
    private Date dtalt;
    @Column(name = "HALT")
    @Temporal(TemporalType.TIME)
    private Date halt;
    @Column(name = "IDUSUALT")
    private String idusualt;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sgpais")
    private Collection<Sguf> sgufCollection;

    public Sgpais() {
    }

    public Sgpais(Short codpais) {
        this.codpais = codpais;
    }

    public Sgpais(Short codpais, String nomepais, String sigla3cpais, String sigla2cpais, Date dtins, Date hins, String idusuins) {
        this.codpais = codpais;
        this.nomepais = nomepais;
        this.sigla3cpais = sigla3cpais;
        this.sigla2cpais = sigla2cpais;
        this.dtins = dtins;
        this.hins = hins;
        this.idusuins = idusuins;
    }

    public Short getCodpais() {
        return codpais;
    }

    public void setCodpais(Short codpais) {
        this.codpais = codpais;
    }

    public String getNomepais() {
        return nomepais;
    }

    public void setNomepais(String nomepais) {
        this.nomepais = nomepais;
    }

    public String getSigla3cpais() {
        return sigla3cpais;
    }

    public void setSigla3cpais(String sigla3cpais) {
        this.sigla3cpais = sigla3cpais;
    }

    public Short getDdipais() {
        return ddipais;
    }

    public void setDdipais(Short ddipais) {
        this.ddipais = ddipais;
    }

    public String getSigla2cpais() {
        return sigla2cpais;
    }

    public void setSigla2cpais(String sigla2cpais) {
        this.sigla2cpais = sigla2cpais;
    }

    public Integer getCodbacenpais() {
        return codbacenpais;
    }

    public void setCodbacenpais(Integer codbacenpais) {
        this.codbacenpais = codbacenpais;
    }

    public String getCodeanpais() {
        return codeanpais;
    }

    public void setCodeanpais(String codeanpais) {
        this.codeanpais = codeanpais;
    }

    public Date getDtins() {
        return dtins;
    }

    public void setDtins(Date dtins) {
        this.dtins = dtins;
    }

    public Date getHins() {
        return hins;
    }

    public void setHins(Date hins) {
        this.hins = hins;
    }

    public String getIdusuins() {
        return idusuins;
    }

    public void setIdusuins(String idusuins) {
        this.idusuins = idusuins;
    }

    public Date getDtalt() {
        return dtalt;
    }

    public void setDtalt(Date dtalt) {
        this.dtalt = dtalt;
    }

    public Date getHalt() {
        return halt;
    }

    public void setHalt(Date halt) {
        this.halt = halt;
    }

    public String getIdusualt() {
        return idusualt;
    }

    public void setIdusualt(String idusualt) {
        this.idusualt = idusualt;
    }

    public Collection<Sguf> getSgufCollection() {
        return sgufCollection;
    }

    public void setSgufCollection(Collection<Sguf> sgufCollection) {
        this.sgufCollection = sgufCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codpais != null ? codpais.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sgpais)) {
            return false;
        }
        Sgpais other = (Sgpais) object;
        if ((this.codpais == null && other.codpais != null) || (this.codpais != null && !this.codpais.equals(other.codpais))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Sgpais[ codpais=" + codpais + " ]";
    }
    
}
